package com.snail.auth.dao;

import com.snail.auth.entity.AuthRole;
import com.common.core.BaseRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

public interface AuthRoleRep extends BaseRepository<AuthRole, Long> {

    @Transactional
    @Modifying
    @Query(value = "insert into auth_role(id,name,type) values(?1,?2,?3)", nativeQuery = true)
    int execInsertNative(Long id, String name, String type);

    AuthRole findByName(String name);
}

